package Riset1;

import Classes.*;
import amd.database.ConnectDB;
import amd.database.DbDocument;
import amd.database.DbTerm;
import amd.database.DbTermDocument;
import java.util.ArrayList;

public class SearchTerm {
    public static ArrayList<ArrayList<String>> Search(String[] s, ConnectDB conn) {
        ArrayList<ArrayList<String>> hasilQterm = new ArrayList<ArrayList<String>>();
        DbTermDocument dbTermDoc=new DbTermDocument();
        try {
            hasilQterm = dbTermDoc.getDocByTermContent(conn, s, 0);
         }
         catch(Exception Ex){
            System.out.println("...DI SINI...");
            System.out.println(Ex.toString());
         }
         return hasilQterm;
    }

    private static TermDoc[] sort(TermDoc sb[]) {
        TermDoc t;
        for(int i=0; i<sb.length-1; i++) {
            for(int j=i+1; j<sb.length; j++){
                if(sb[i].getBobot() < sb[j].getBobot()) {
                    t = sb[i];
                    sb[i] = sb[j];
                    sb[j] = t;
                }
            }
        }
        return sb;
    }
}
